import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import {
  Layout,
  Button,
  Table,
  Menu,
  MenuItem,
  Submenu,
  MenuGroup,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  // Page,
  Input,
  RadioGroup,
  Radio,
  Checkbox,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  DatePicker,
  TimePicker,
  Form,
  FormItem,
  Icon,
  Modal,
  Tree,
  Spin,
  Card,
  Message,
  Alert,
  Tag,
  Tabs,
  TabPane,
  Upload,
  Cascader,
  Row,
  Col,
  Tooltip,
  Breadcrumb,
  BreadcrumbItem,
  Drawer,
  Divider,
  Progress,
  Poptip,
  Badge,
  AutoComplete,
  CellGroup,
  Cell,
  InputNumber,
  Collapse,
  Panel,
  ColorPicker,
  Timeline,
  TimelineItem,
  Steps,
  Step,
  OptionGroup,
  Rate
} from 'iview'

import Page from './pages/Common/Page/page'
import jsoneditor from 'jsoneditor'
import VueCookies from 'vue-cookies'
import 'jsoneditor/dist/jsoneditor.min.css'
import './assets/font/iconfont.css'
import './assets/styles/base.css'
import 'iview/dist/styles/iview.css'
import 'nprogress/nprogress.css'

// 主题
import './assets/styles/themeBlue.css'

Vue.config.productionTip = false
Vue.use(VueCookies)

// 全局注册
Vue.component('Layout', Layout)
Vue.component('Button', Button)
Vue.component('i-button', Button)
Vue.component('Table', Table)
Vue.component('Menu', Menu)
Vue.component('MenuItem', MenuItem)
Vue.component('Submenu', Submenu)
Vue.component('MenuGroup', MenuGroup)
Vue.component('Dropdown', Dropdown)
Vue.component('DropdownItem', DropdownItem)
Vue.component('DropdownMenu', DropdownMenu)
Vue.component('Page', Page)
Vue.component('Input', Input)
Vue.component('i-input', Input)
Vue.component('RadioGroup', RadioGroup)
Vue.component('Radio', Radio)
Vue.component('Checkbox', Checkbox)
Vue.component('i-switch', Switch)
Vue.component('Select', Select)
Vue.component('i-select', Select)
Vue.component('Option', Option)
Vue.component('OptionGroup', OptionGroup)
Vue.component('i-option', Option)
Vue.component('DatePicker', DatePicker)
Vue.component('i-datepicker', DatePicker)
Vue.component('TimePicker', TimePicker)
Vue.component('i-timepicker', TimePicker)
Vue.component('Form', Form)
Vue.component('FormItem', FormItem)
Vue.component('Icon', Icon)
Vue.component('Tree', Tree)
Vue.component('Card', Card)
Vue.component('Spin', Spin)
Vue.component('Alert', Alert)
Vue.component('Tag', Tag)
Vue.component('Tabs', Tabs)
Vue.component('TabPane', TabPane)
Vue.component('Upload', Upload)
Vue.component('Cascader', Cascader)
Vue.component('Row', Row)
Vue.component('Col', Col)
Vue.component('i-col', Col)
Vue.component('Tooltip', Tooltip)
Vue.component('Breadcrumb', Breadcrumb)
Vue.component('BreadcrumbItem', BreadcrumbItem)
Vue.component('Drawer', Drawer)
Vue.component('Divider', Divider)
Vue.component('Poptip', Poptip)
Vue.component('Modal', Modal)
Vue.component('Drawer', Drawer)
Vue.component('Progress', Progress)
Vue.component('Badge', Badge)
Vue.component('AutoComplete', AutoComplete)
Vue.component('CellGroup', CellGroup)
Vue.component('Cell', Cell)
Vue.component('InputNumber', InputNumber)
Vue.component('Collapse', Collapse)
Vue.component('Panel', Panel)
Vue.component('ColorPicker', ColorPicker)
Vue.component('CheckboxGroup', CheckboxGroup)
Vue.component('Timeline', Timeline)
Vue.component('TimelineItem', TimelineItem)
Vue.component('Steps', Steps)
Vue.component('Step', Step)
Vue.component('Rate', Rate)

// 注册一个全局自定义指令 `v-focus`，默认focus
Vue.directive('focus', {
  inserted: function (el) {
    el.focus();
  }
});

Vue.prototype.$Message = Message
Vue.prototype.$Modal = Modal
Vue.prototype.$jsoneditor = jsoneditor

// eslint-disable-next-line no-new
new Vue({
  el: '#app',
  components: {
    App
  },
  template: '<App/>',
  router,
  store
});
